package com.tuyrt.`as`.proj.kotlin_demo

/**
 * author: Administrator on 2021/5/20.
 * desc:
 */
fun main() {
    //println(Coke().taste().price)
    BlueColor(Blue()).printColor()
}

interface Drinks<T> {
    fun taste(): T
    fun price(t: T)
}

class Sweet {
    val price = 5
}

class Coke : Drinks<Sweet> {

    override fun taste(): Sweet {
        println("Sweet")
        return Sweet()
    }

    override fun price(t: Sweet) {
        println("Coke price:${t.price}")
    }
}

abstract class Color<T>(var t: T) {
    abstract fun printColor()
}

class Blue {
    val color = "Blue"
}

class BlueColor(blue: Blue) : Color<Blue>(blue) {
    override fun printColor() {
        println("color: ${t.color}")
    }
}